<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title><%= htmlWebpackPlugin.options.title %></title>
    <script>
      // 页面加载完成后动态生成favicon
      document.addEventListener('DOMContentLoaded', function() {
        // 创建SVG图标
        const svgString = `
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
            <rect x="20" y="15" width="60" height="70" rx="5" fill="#3b82f6"/>
            <rect x="25" y="20" width="50" height="60" rx="3" fill="#ffffff"/>
            <line x1="30" y1="30" x2="70" y2="30" stroke="#3b82f6" stroke-width="2"/>
            <line x1="30" y1="40" x2="70" y2="40" stroke="#3b82f6" stroke-width="2"/>
            <line x1="30" y1="50" x2="70" y2="50" stroke="#3b82f6" stroke-width="2"/>
            <line x1="30" y1="60" x2="70" y2="60" stroke="#3b82f6" stroke-width="2"/>
            <polygon points="65,25 75,35 70,40 60,30" fill="#10b981"/>
          </svg>
        `;
        
        // 将SVG转换为Base64
        const svgBase64 = btoa(svgString);
        
        // 创建favicon链接
        const link = document.createElement('link');
        link.rel = 'icon';
        link.href = `data:image/svg+xml;base64,${svgBase64}`;
        link.type = 'image/svg+xml';
        
        // 添加到head中
        document.head.appendChild(link);
      });
    </script>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>